package visao;


import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Font;
import java.awt.SystemColor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;

            @SuppressWarnings("serial")  
	      
	    public class TelaPrincipal extends JFrame {     
	    
	        public JFrame frame;     
	        @SuppressWarnings("unused")
                
			private final Action action = new SwingAction();
              
	        private JMenuItem menuItemCadastroDeCliente;
	    
	       public TelaPrincipal() {     
	  
	   //Configurações do Frame         
	         super("Agencia");
	           
	       getContentPane().setBackground(new Color(0, 0, 255));
	       getContentPane().setForeground(SystemColor.desktop);
	       setSize(700, 700);     
	       setLocation(180,20);  
	       setDefaultCloseOperation(EXIT_ON_CLOSE); 
	    
	     JMenuBar barra = new JMenuBar();     
	       setJMenuBar(barra);     
	      
	      
	    	  
	    	   
	    setBackground(Color.white);
	    JLabel label2 = new JLabel("BEM VINDOS !!!!!",new ImageIcon("F:\\JONES\\VendasDeCarros\\Imagem\\camaro (1).gif"),JLabel.CENTER);
	    label2.setForeground(Color.YELLOW);
	    label2.setFont(new Font("Stencil", Font.PLAIN, 25));
	    label2.setBackground(UIManager.getColor("Button.background"));
	    label2.setLabelFor(this);
	    label2.setHorizontalTextPosition(JLabel.CENTER);
	     getContentPane().add(label2, BorderLayout.NORTH);
	         
	       JMenu menuCadastro = new JMenu("Cadastro");     
	       barra.add(menuCadastro);
	    
	//MENU CADASTRO  
	//Referênte ao Cadastro de Clientes  
	     menuItemCadastroDeCliente = new JMenuItem(" Cliente");
	     menuCadastro.add(menuItemCadastroDeCliente);
	     
	     
	     //Chama Cadastro de Cliente 
	     
	     menuItemCadastroDeCliente.addActionListener(new ActionListener() {  
	    
                 @Override
		public void actionPerformed(ActionEvent e) {
	    	 CadastroCliente ca = new CadastroCliente();   
	    	 ca.setVisible(true);
	    	  Container tela = getContentPane();
	          getContentPane().setLayout(null);
	          frame = new JFrame("CadastroCliente");//Frame e abaixo suas configurações     
	         frame.setSize(400, 400);     
	         frame.setLocation(300,100);  
	        
	           
	          }     
	      });
	     
	
	       }
	    
		    protected void setBorder(EmptyBorder emptyBorder) {
				
			}
		
			public static void main(String[] args) {  
                                               
		        TelaPrincipal teste = new TelaPrincipal();     
		        teste.  
		        setVisible(false);     
		    }     
		    private class SwingAction extends AbstractAction {
		    		public SwingAction() {
		    	putValue(NAME, "SwingAction");
		    	putValue(SHORT_DESCRIPTION, "Some short description");
		    		}
                        @Override
		    public void actionPerformed(ActionEvent e) {
		    		}
		    	}
		    public JMenuItem getMenuItemCadastroDeCliente() {
	    		return menuItemCadastroDeCliente;
	    	}

	    }   
	    